package cn.com.my.yzt.json;

import java.util.Map;

import cn.com.util.GsonUtil;


public class JsonUtil {

	public static void main(String[] args) {
		String str = "{"
		    +"'code': '6905070601772',"
		    +"'count': 1924,"
		    +"'description': 'xx',"
		    +"'factory': '大同市利群药业有限责任公司',"
		    +"'fcount': 0,"
		    +"'id': 10,"
		    +"'img': 'yy',"
		    +"'keywords': '本品 医师 儿童 收起 展开 ',"
		    +"'name': '牛磺酸胶囊',"
		    +"'price': 503,"
		    +"'rcount': 0,"
		    +"'status': true,"
		    +"'tag': '解热镇痛,过敏,其他,其他药品,维生素',"
		    +"'type': '化学药品'"
		    +"}";
		System.out.println(str);
		Map<String, Object> map = GsonUtil.json2bean(str, Map.class);
		
		System.out.println(map);
		
		
		Drug d = new Drug(100L, "VBC");
		
		Map<String, Object> map2 = GsonUtil.json2bean(GsonUtil.bean2json(d), Map.class);
		System.out.println(map2);
	}
	
	

}
